-
Notifications
You must be signed in to change notification settings - Fork 3
Fix/podspec enable name handling #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The serviceAccount values were changed to a (create/name), but the podspec was still expecting a flat string. This fix restores the correct serviceAccountName mapping.
Summary of ChangesHello @PhennyOpsta, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request streamlines the management of Kubernetes ServiceAccounts within the Helm chart ecosystem. It introduces a more direct way to specify ServiceAccount names, moving from a nested object structure to a simple string value. This change simplifies the ServiceAccount creation template and its integration into PodSpecs, ensuring a more consistent and easier-to-manage configuration across various applications leveraging the common chart. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request aims to simplify the ServiceAccount configuration. However, a potential YAML injection vulnerability was identified in the ServiceAccount template where user-supplied values are used without proper quoting, which could allow for the injection of malicious metadata. Additionally, the current implementation introduces a significant regression by removing the ability to use pre-existing ServiceAccounts and also removes standard labels from created resources. Several chart versions have also been incorrectly decremented, which needs to be addressed.
| # to the chart and its templates, including the app version. | ||
| # Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
| version: 0.78.0 | ||
| version: 0.77.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The chart version has been decremented from 0.78.0 to 0.77.0. This violates Semantic Versioning principles and can break dependency management and deployment pipelines. The version should be incremented to reflect the new changes. Given this is a feature change, a minor version bump is appropriate.
version: 0.79.0| # to the chart and its templates, including the app version. | ||
| # Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
| version: 0.78.0 | ||
| version: 0.77.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The chart version has been decremented from 0.78.0 to 0.77.0. This violates Semantic Versioning principles and can break dependency management and deployment pipelines. The version should be incremented to reflect the new changes. Given this is a feature change, a minor version bump is appropriate.
version: 0.79.0| # to the chart and its templates, including the app version. | ||
| # Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
| version: 0.78.0 | ||
| version: 0.77.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The chart version has been decremented from 0.78.0 to 0.77.0. This violates Semantic Versioning principles and can break dependency management and deployment pipelines. The version should be incremented to reflect the new changes. Given this is a feature change, a minor version bump is appropriate.
version: 0.79.0| kind: ServiceAccount | ||
| metadata: | ||
| name: {{ .Values.serviceAccount.name | default (include "onechart.fullname" .) }} | ||
| name: {{ .Values.serviceAccount }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A YAML injection vulnerability exists here as the user-provided value .Values.serviceAccount is rendered directly without quoting, potentially allowing for malicious metadata injection. It is critical to use the quote function to prevent this. Furthermore, the current ServiceAccount creation logic in this block introduces a regression by removing the ability to use existing ServiceAccounts and omitting standard labels, which are essential for resource management.
name: {{ .Values.serviceAccount | quote }}| "$id": "#/properties/serviceAccount", | ||
| "type": "string", | ||
| "title": "The name of service account", | ||
| "description": "Name of the Kubernetes ServiceAccount to associate with this workload. If not specified, the chart will automatically create one.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description for serviceAccount is misleading. It states "If not specified, the chart will automatically create one." However, the template logic in _serviceaccount.yaml ({{- if .Values.serviceAccount }}) will only create a service account if a name is provided. If it's not specified (i.e., an empty string), no service account is created. The description should be updated to accurately reflect the actual behavior of the chart.
| "description": "Name of the Kubernetes ServiceAccount to associate with this workload. If not specified, the chart will automatically create one.", | |
| "description": "Name of the Kubernetes ServiceAccount to associate with this workload. If a name is provided, a new ServiceAccount will be created with that name. If not specified, no ServiceAccount will be created or used.", |
Improve the ServiceAccount creation process and update how it is referenced and configured within the PodSpec.